
package edu.java.homework.hw07.test0616;

class A{}
class B extends A{}

public  class Test0616{
	public static void main(String[] args){
		A[] arrA;
		B[] arrB;

		arrA= new A[10];
		arrB= new B[20];
		arrA= arrB;					// ( 1 )
		arrB= (B[])arrA;				// ( 2 )

		arrA= new A[10];
		arrB= (B[]) arrA;				// ( 3 )
	}
}


/* Posochete pravilnoto tvyrdenie:
( a ) Greshka pri translaciia na red  ( 1 )
( b ) Greshka ClassCastException  v red ( 2 ) po vreme na izpylnenie;
( c ) Greshka jClassCastException  v red ( 3 ) po vreme na izpylnenie;
( d ) Щe se translira i izpylni bez problemi dori ako premahnem (B[]) v redovete (2) i (3);
( e ) Щe se translira i izpylni bez problemi no samo ako ne premahnem (B[]) v redovete (2) i (3);
( f ) Nito edno ot gornite tvyrdeniia ne e viarno.  
*/

// Result: C)